import React from 'react'
import { Cascader ,Table,Icon,Modal,Popconfirm,Message,Form,Row,Select,Col,Button,Input,DatePicker} from 'antd';
import api from '../../../api/dictdown';
import { Map, Marker} from 'react-amap';
import './index.less'

export default class DictSelectType extends React.Component {

  state = { 
    child:[],
  };

  handleSelect= (params = {}) => {
    let childrend=[];
    childrend =this.state.child;
    const Option = Select.Option;
    api.get('/queryAll', {   //查询所有
    }).then((data) => {
      console.log(data)
       this.state.type=""; 
      data.data.forEach(function(value, index, array) {
        childrend.push(<Option key={value.type+"_"+value.value} >{value.label}</Option>);
       }) 
       this.state.child=childrend; 
    });
}


componentDidMount = () =>{
   this.handleSelect();
}

  render() {
    let _this = this;
    return (
      <div className="">
        <Select
                  mode="combobox"
                  style={{ width: 200 }}
                  placeholder="选择一个类型"
                >
                  {_this.state.child}
                </Select>
      </div >
    )
  }
}